package fr.insee.solr.service.impl;


import java.util.List;
import java.util.Map;

import fr.insee.solr.service.SolrCreateService;
import fr.insee.solr.service.SolrReadService;
import fr.insee.solr.service.SolrBeanService;


public class ConcreateBeanService<U> implements SolrBeanService<U> {

	private SolrCreateService<U> indexer = new SolrBeanIndexer<>();
	
	private SolrReadService<U> reader = new SolrBeanRequest<>();
	
	
	public ConcreateBeanService() {
	
	}
	

	@Override
	public Map<String, Object> getFieldsValue(U o) throws SolrInseeException {
		return this.indexer.getFieldsValue(o);
	}


	@Override
	public List<U> makeBeans(List<Map<String, Object>> fields, Class<U> clazz) throws SolrInseeException {
		return this.reader.makeBeans(fields,clazz);
	}




}
